package com.netbao.fin.controller;




import com.netbao.fin.model.Subtotal;
import com.netbao.fin.service.QingService;
import com.netbao.model.PageBean;
import com.netbao.model.PageResult;
import com.netbao.model.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @author suqk
 * @create 2019-11-05 14:40
 */
@Controller
@RequestMapping("fin/qing")
public class QingController {
    @Autowired
    private QingService qingService;
    @RequestMapping("page")
    public String page(){
        return "fin/payapp";
    }
    @GetMapping("/listAll")
    @ResponseBody
    public PageResult listAll(PageBean pageBean, String name){
        return qingService.listAll(pageBean,name);
    }
    @PostMapping("save")
    @ResponseBody
    public Result saveup(Long id) {
        return qingService.saveup(id);
    }
    @PostMapping("exit")
    @ResponseBody
    public Result exit(Long id) {
        return qingService.exit(id);
    }
    @GetMapping("list")
    @ResponseBody
    public List<Subtotal> list(Long id){
        return qingService.list(id);
    }
}
